home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_gen_radio_chatter.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  143 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_radio_chatter.cog
  4. #
  5. # Generic Door Script
  6. #
  7. # [CMG]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.     
  14.  
  15.     #..................MESSAGES................
  16.     message        startup    
  17.     message        crossed    
  18.     message        pulse    
  19.     
  20.     #..................PROPS................
  21.     thing        soundobj
  22.  
  23.     #..................ACTORS................
  24.     thing        player                                  local
  25.     
  26.         
  27.     #..................TRIGGERS................
  28.     surface        startsurf0                                linkID=2     
  29.     surface        startsurf1                                linkID=2     
  30.  
  31.     surface        endsurf0                                linkID=3     
  32.     surface        endsurf1                                linkID=3     
  33.  
  34.  
  35.     #..................VARIABLES................
  36.     int            inrange=0                                  local
  37.     int            minDist
  38.     int            maxDist
  39.     int            vol=1                                    local
  40.     int            snd                                        local
  41.     int            chattertime                                local        # int for holding Rand value
  42.     int            i                                        local        # int for for loops
  43.         
  44.     
  45.     #..................SOUND................
  46.     sound       chatter0=riv_radio_chatter_a1.wav        local
  47.     sound       chatter1=riv_radio_chatter_a2.wav        local
  48.     sound       chatter2=riv_radio_chatter_a3.wav        local
  49.     sound       chatter3=riv_radio_chatter_a4.wav        local
  50.     sound       chatter4=riv_radio_chatter_a5.wav        local
  51.     
  52. end
  53.  
  54. # ========================================================================================
  55.  
  56. code
  57.  
  58. # ........................................................................................
  59. startup:
  60.  
  61.     player = GetLocalPlayerThing();
  62. return;
  63.  
  64. # ........................................................................................
  65. crossed:
  66.  
  67. if (getSourceRef() != player) return;
  68.  
  69.  
  70. if (GetSenderID() == 2)    # start the sounds
  71.  
  72. {
  73.     If (inrange != 1)
  74.         {
  75.         inrange = 1;
  76.         }
  77.     chattertime=RandBetween(6, 12);
  78.     SetPulse(chattertime);
  79.     #print("radio timer set");
  80. }
  81.  
  82. if (GetSenderID() == 3)    # stop the sounds
  83.  
  84. {
  85.     If (inrange != 0)
  86.         {
  87.         inrange = 0;
  88.         }
  89.     SetPulse(0);
  90.     #print("radio timer cut");
  91. }
  92.     
  93. return;        
  94. #========================================================
  95. pulse:
  96.  
  97. #print("pulse hit");
  98.  
  99. i=RandBetween(0,4);    # choose a sound
  100.  
  101. If (i == 0)
  102.     {
  103.     PlaySoundThing(chatter0, soundobj, vol, minDist, maxDist, 0x0);
  104.     }
  105.  
  106. If (i == 1)
  107.     {
  108.     PlaySoundThing(chatter1, soundobj, vol, minDist, maxDist, 0x0);
  109.     }
  110.  
  111. If (i == 2)
  112.     {
  113.     PlaySoundThing(chatter2, soundobj, vol, minDist, maxDist, 0x0);
  114.     }
  115.  
  116. If (i == 3)
  117.     {
  118.     PlaySoundThing(chatter3, soundobj, vol, minDist, maxDist, 0x0);
  119.     }
  120.  
  121. If (i == 4)
  122.     {
  123.     PlaySoundThing(chatter4, soundobj, vol, minDist, maxDist, 0x0);
  124.     }
  125.  
  126.  
  127. If (inrange == 1)
  128.     {
  129.     chattertime=RandBetween(6, 12);
  130.     SetPulse(chattertime);
  131.     }
  132.  
  133. return;
  134.  
  135. #========================================================
  136.  
  137.  
  138.  
  139.  
  140.  
  141. end
  142.  
  143.